home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume6 / xfig2 / patch5f < prev    next >
Encoding:
Internet Message Format  |  1993-04-28  |  46.7 KB

  1. From: envbvs@epb2.lbl.gov (Brian V. Smith)
  2. Newsgroups: comp.sources.x
  3. Subject: v06i055: xfig 2.0 (part 6/7), Patch5
  4. Message-ID: <133696@sun.Eng.Sun.COM>
  5. Date: 30 Mar 90 04:34:58 GMT
  6. Approved: argv@sun.com
  7.  
  8. Submitted-by: envbvs@epb2.lbl.gov (Brian V. Smith)
  9. Posting-number: Volume 6, Issue 55
  10. Archive-name: xfig2/patch5f
  11. Patch-To: xfig2: Volume 6, Issue 9-24,34-36
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 6 (of 7)."
  20. # Contents:  f2p.c.diff
  21. # Wrapped by envbvs@epb2.lbl.gov on Wed Mar 28 09:05:13 1990
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'f2p.c.diff' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'f2p.c.diff'\"
  25. else
  26. echo shar: Extracting \"'f2p.c.diff'\" \(44019 characters\)
  27. sed "s/^X//" >'f2p.c.diff' <<'END_OF_FILE'
  28. X*** f2p.c.p5    Tue Jan 16 17:21:05 1990
  29. X--- f2p.c    Tue Mar 27 08:23:02 1990
  30. X***************
  31. X*** 5,10
  32. X   *    January 1985.
  33. X   *    1st revision : October 1985.
  34. X   *    2nd revision : March 1988 - read fig 1.4
  35. X   *
  36. X   *    %W%    %G%
  37. X  */
  38. X
  39. X--- 5,12 -----
  40. X   *    January 1985.
  41. X   *    1st revision : October 1985.
  42. X   *    2nd revision : March 1988 - read fig 1.4
  43. X+  *    Support for fonts and point sizes added by daved@physiol.su.oz.au
  44. X+  *        March 1990
  45. X   *
  46. X   *    %W%    %G%
  47. X  */
  48. X***************
  49. X*** 10,15
  50. X  */
  51. X  #include "fig.h"
  52. X  #include "object.h"
  53. X  
  54. X  char        Usage[] = "Usage: f2p [ -s font_size ] [ input_file [ output_file ] ]\n";
  55. X  char        *from = NULL, *to = NULL;
  56. X
  57. X--- 12,19 -----
  58. X  */
  59. X  #include "fig.h"
  60. X  #include "object.h"
  61. X+ #include "troff_fonts.h"
  62. X+ #include "psfonts.h"
  63. X  
  64. X  char        Usage[] = "Usage: f2p [ -f font_file ] [ input_file [ output_file ] ]\n";
  65. X  char        *from = NULL,
  66. X***************
  67. X*** 11,20
  68. X  #include "fig.h"
  69. X  #include "object.h"
  70. X  
  71. X! char        Usage[] = "Usage: f2p [ -s font_size ] [ input_file [ output_file ] ]\n";
  72. X! char        *from = NULL, *to = NULL;
  73. X! FILE        *ffp = NULL, *tfp = NULL;
  74. X! int        font_size = 11;        /* points */
  75. X  char        Err_incomp[] = "Incomplete %s object at line %d.";
  76. X  char        Err_mem[] = "Running out of memory.";
  77. X  
  78. X
  79. X--- 15,24 -----
  80. X  #include "troff_fonts.h"
  81. X  #include "psfonts.h"
  82. X  
  83. X! char        Usage[] = "Usage: f2p [ -f font_file ] [ input_file [ output_file ] ]\n";
  84. X! char        *from = NULL,
  85. X!         *to = NULL;
  86. X! FILE        *tfp = NULL;
  87. X  char        Err_incomp[] = "Incomplete %s object at line %d.";
  88. X  char        Err_mem[] = "Running out of memory.";
  89. X  
  90. X***************
  91. X*** 18,23
  92. X  char        Err_incomp[] = "Incomplete %s object at line %d.";
  93. X  char        Err_mem[] = "Running out of memory.";
  94. X  
  95. X  put_msg(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
  96. X  char   *format, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8;
  97. X  {
  98. X
  99. X--- 22,33 -----
  100. X  char        Err_incomp[] = "Incomplete %s object at line %d.";
  101. X  char        Err_mem[] = "Running out of memory.";
  102. X  
  103. X+ int        line_thickness; /* not for f2ps - arrow.c needs it for fig */
  104. X+ extern    struct    _fstruct fontnames[];        /* printer font names */
  105. X+ int        dotps,        /* most recent size passed to .ps */
  106. X+         dotft;        /* one more than num of font passed to .ft */
  107. X+ 
  108. X+ /*VARARGS1*/
  109. X  put_msg(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
  110. X  char   *format, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8;
  111. X  {
  112. X***************
  113. X*** 22,28
  114. X  char   *format, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8;
  115. X  {
  116. X      fprintf(stderr, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
  117. X!     }
  118. X  
  119. X  get_args(argc, argv)
  120. X  int     argc;
  121. X
  122. X--- 32,39 -----
  123. X  char   *format, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8;
  124. X  {
  125. X      fprintf(stderr, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
  126. X!     fputc('\n',stderr);
  127. X! }
  128. X  
  129. X  get_args(argc, argv)
  130. X  int     argc;
  131. X***************
  132. X*** 31,46
  133. X      char    *a;
  134. X      int    first = 1;
  135. X  
  136. X!     while (--argc) {
  137. X!         a = *++argv;
  138. X!         if (*a == '-') {
  139. X!         if (*++a == 's') {    /* Font size followed */
  140. X!             if (--argc) {
  141. X!             font_size = atoi(*++argv);
  142. X!             if (font_size <= 0 || font_size > 30) {
  143. X!                 fprintf(stderr, Usage);
  144. X!                 exit(0);
  145. X!                 }
  146. X              }
  147. X              else {
  148. X              fprintf(stderr, Usage);
  149. X
  150. X--- 42,61 -----
  151. X      char    *a;
  152. X      int    first = 1;
  153. X  
  154. X!     while (--argc)
  155. X!     {
  156. X!         a = *++argv;
  157. X!         if (*a == '-')
  158. X!         {
  159. X!             if (*++a == 'f')
  160. X!             {
  161. X!                 if (--argc)
  162. X!                     font_file = *++argv;
  163. X!                 else
  164. X!                 {
  165. X!                     fprintf(stderr, Usage);
  166. X!                     exit(0);
  167. X!                 }
  168. X              }
  169. X              else
  170. X              {
  171. X***************
  172. X*** 42,50
  173. X                  exit(0);
  174. X                  }
  175. X              }
  176. X!             else {
  177. X!             fprintf(stderr, Usage);
  178. X!             exit(0);
  179. X              }
  180. X              }
  181. X          else {
  182. X
  183. X--- 57,66 -----
  184. X                      exit(0);
  185. X                  }
  186. X              }
  187. X!             else
  188. X!             {
  189. X!                 fprintf(stderr, Usage);
  190. X!                 exit(0);
  191. X              }
  192. X          }
  193. X          else if (first)
  194. X***************
  195. X*** 46,56
  196. X              fprintf(stderr, Usage);
  197. X              exit(0);
  198. X              }
  199. X-             }
  200. X-         else {
  201. X-             fprintf(stderr, Usage);
  202. X-             exit(0);
  203. X-             }
  204. X          }
  205. X          else if (first) {
  206. X          from = a;    /*  from file  */
  207. X
  208. X--- 62,67 -----
  209. X                  fprintf(stderr, Usage);
  210. X                  exit(0);
  211. X              }
  212. X          }
  213. X          else if (first)
  214. X          {
  215. X***************
  216. X*** 52,60
  217. X              exit(0);
  218. X              }
  219. X          }
  220. X!         else if (first) {
  221. X!         from = a;    /*  from file  */
  222. X!         first = 0;
  223. X          }
  224. X          else if (first == 0) {
  225. X          to = a;        /*  to file  */
  226. X
  227. X--- 63,72 -----
  228. X                  exit(0);
  229. X              }
  230. X          }
  231. X!         else if (first)
  232. X!         {
  233. X!             from = a;    /*  from file  */
  234. X!             first = 0;
  235. X          }
  236. X          else if (first == 0)
  237. X          {
  238. X***************
  239. X*** 56,64
  240. X          from = a;    /*  from file  */
  241. X          first = 0;
  242. X          }
  243. X!         else if (first == 0) {
  244. X!         to = a;        /*  to file  */
  245. X!         first = -1;
  246. X          }
  247. X          else
  248. X          fprintf(stderr, Usage);
  249. X
  250. X--- 68,77 -----
  251. X              from = a;    /*  from file  */
  252. X              first = 0;
  253. X          }
  254. X!         else if (first == 0)
  255. X!         {
  256. X!             to = a;        /*  to file  */
  257. X!             first = -1;
  258. X          }
  259. X          else
  260. X              fprintf(stderr, Usage);
  261. X***************
  262. X*** 60,68
  263. X          to = a;        /*  to file  */
  264. X          first = -1;
  265. X          }
  266. X!         else
  267. X!         fprintf(stderr, Usage);
  268. X!         }
  269. X      }
  270. X  
  271. X  main(argc, argv)
  272. X
  273. X--- 73,80 -----
  274. X              to = a;        /*  to file  */
  275. X              first = -1;
  276. X          }
  277. X!         else
  278. X!             fprintf(stderr, Usage);
  279. X      }
  280. X  }
  281. X  
  282. X***************
  283. X*** 64,69
  284. X          fprintf(stderr, Usage);
  285. X          }
  286. X      }
  287. X  
  288. X  main(argc, argv)
  289. X  int     argc;
  290. X
  291. X--- 76,82 -----
  292. X          else
  293. X              fprintf(stderr, Usage);
  294. X      }
  295. X+ }
  296. X  
  297. X  main(argc, argv)
  298. X  int     argc;
  299. X***************
  300. X*** 71,77
  301. X  {
  302. X      F_compound    objects;
  303. X      int        status;
  304. X-     char        c;
  305. X  
  306. X      get_args(argc, argv);
  307. X      if (to == NULL)
  308. X
  309. X--- 84,89 -----
  310. X  {
  311. X      F_compound    objects;
  312. X      int        status;
  313. X  
  314. X      get_args(argc, argv);
  315. X      troff_init();
  316. X***************
  317. X*** 74,79
  318. X      char        c;
  319. X  
  320. X      get_args(argc, argv);
  321. X      if (to == NULL)
  322. X          tfp = stdout;
  323. X      else if ((tfp = fopen(to, "w")) == NULL) {
  324. X
  325. X--- 86,92 -----
  326. X      int        status;
  327. X  
  328. X      get_args(argc, argv);
  329. X+     troff_init();
  330. X      if (to == NULL)
  331. X          tfp = stdout;
  332. X      else if ((tfp = fopen(to, "w")) == NULL)
  333. X***************
  334. X*** 75,86
  335. X  
  336. X      get_args(argc, argv);
  337. X      if (to == NULL)
  338. X!         tfp = stdout;
  339. X!     else if ((tfp = fopen(to, "w")) == NULL) {
  340. X!         fprintf(stderr, "Couldn't open %s\n", to);
  341. X!         fprintf(stderr, Usage);
  342. X!         exit(0);
  343. X!         }
  344. X  
  345. X      if (from)
  346. X          status = read_fig(from, &objects);
  347. X
  348. X--- 88,100 -----
  349. X      get_args(argc, argv);
  350. X      troff_init();
  351. X      if (to == NULL)
  352. X!         tfp = stdout;
  353. X!     else if ((tfp = fopen(to, "w")) == NULL)
  354. X!     {
  355. X!         fprintf(stderr, "Couldn't open %s\n", to);
  356. X!         fprintf(stderr, Usage);
  357. X!         exit(0);
  358. X!     }
  359. X  
  360. X      if (from)
  361. X          status = read_fig(from, &objects);
  362. X***************
  363. X*** 83,89
  364. X          }
  365. X  
  366. X      if (from)
  367. X!         status = read_fig(from, &objects);
  368. X      else     /* read from stdin */
  369. X          status = readfp_fig(stdin, &objects);
  370. X  
  371. X
  372. X--- 97,103 -----
  373. X      }
  374. X  
  375. X      if (from)
  376. X!         status = read_fig(from, &objects);
  377. X      else     /* read from stdin */
  378. X      status = readfp_fig(stdin, &objects);
  379. X  
  380. X***************
  381. X*** 85,91
  382. X      if (from)
  383. X          status = read_fig(from, &objects);
  384. X      else     /* read from stdin */
  385. X!         status = readfp_fig(stdin, &objects);
  386. X  
  387. X      if (status != 0) {
  388. X          if (from) read_fail_message(from, status);
  389. X
  390. X--- 99,105 -----
  391. X      if (from)
  392. X          status = read_fig(from, &objects);
  393. X      else     /* read from stdin */
  394. X!     status = readfp_fig(stdin, &objects);
  395. X  
  396. X      if (status != 0)
  397. X      {
  398. X***************
  399. X*** 87,96
  400. X      else     /* read from stdin */
  401. X          status = readfp_fig(stdin, &objects);
  402. X  
  403. X!     if (status != 0) {
  404. X!         if (from) read_fail_message(from, status);
  405. X!         exit(0);
  406. X!         }
  407. X      genpic_objects(&objects);
  408. X      if (tfp != stdout) fclose(tfp);
  409. X      }
  410. X
  411. X--- 101,111 -----
  412. X      else     /* read from stdin */
  413. X      status = readfp_fig(stdin, &objects);
  414. X  
  415. X!     if (status != 0)
  416. X!     {
  417. X!         if (from) read_fail_message(from, status);
  418. X!         exit(0);
  419. X!     }
  420. X      genpic_objects(&objects);
  421. X      if (tfp != stdout) fclose(tfp);
  422. X  }
  423. X***************
  424. X*** 93,99
  425. X          }
  426. X      genpic_objects(&objects);
  427. X      if (tfp != stdout) fclose(tfp);
  428. X!     }
  429. X  
  430. X  #define            TOP    10.5    /* top of page is 10.5 inch */
  431. X  static double        ppi;
  432. X
  433. X--- 108,114 -----
  434. X      }
  435. X      genpic_objects(&objects);
  436. X      if (tfp != stdout) fclose(tfp);
  437. X! }
  438. X  
  439. X  #define            TOP    10.5    /* top of page is 10.5 inch */
  440. X  static double        ppi;
  441. X***************
  442. X*** 104,110
  443. X  double    a;
  444. X  {
  445. X      return((double)(CONV ? TOP-a : a));
  446. X!     }
  447. X  
  448. X  genpic_objects(objects)
  449. X  F_compound    *objects;
  450. X
  451. X--- 119,125 -----
  452. X  double    a;
  453. X  {
  454. X      return((double)(CONV ? TOP-a : a));
  455. X! }
  456. X  
  457. X  genpic_objects(objects)
  458. X  F_compound    *objects;
  459. X***************
  460. X*** 117,126
  461. X      F_spline    *s;
  462. X      F_text        *t;
  463. X  
  464. X!     if (0 == (ppi = (double)objects->nwcorner.x)) {
  465. X!         fprintf(stderr, "Resolution is zero!! default to 80 ppi\n");
  466. X!         ppi = 80.0;
  467. X!         }
  468. X      coord_system = objects->nwcorner.y;
  469. X      if (coord_system != 1 && coord_system != 2) {
  470. X          fprintf(stderr, "Wrong coordinate system; cannot continue\n");
  471. X
  472. X--- 132,142 -----
  473. X      F_spline    *s;
  474. X      F_text        *t;
  475. X  
  476. X!     if (0 == (ppi = (double)objects->nwcorner.x))
  477. X!     {
  478. X!         fprintf(stderr, "Resolution is zero!! default to 80 ppi\n");
  479. X!         ppi = 80.0;
  480. X!     }
  481. X      coord_system = objects->nwcorner.y;
  482. X      if (coord_system != 1 && coord_system != 2)
  483. X      {
  484. X***************
  485. X*** 122,131
  486. X          ppi = 80.0;
  487. X          }
  488. X      coord_system = objects->nwcorner.y;
  489. X!     if (coord_system != 1 && coord_system != 2) {
  490. X!         fprintf(stderr, "Wrong coordinate system; cannot continue\n");
  491. X!         return;
  492. X!         }
  493. X      if (coord_system == 2) CONV = 1;
  494. X  
  495. X      fprintf(tfp, ".PS\n");    /* PostScript magic strings */
  496. X
  497. X--- 138,148 -----
  498. X          ppi = 80.0;
  499. X      }
  500. X      coord_system = objects->nwcorner.y;
  501. X!     if (coord_system != 1 && coord_system != 2)
  502. X!     {
  503. X!         fprintf(stderr, "Wrong coordinate system; cannot continue\n");
  504. X!         return;
  505. X!     }
  506. X      if (coord_system == 2) CONV = 1;
  507. X  
  508. X      fprintf(tfp, ".PS\n");    /* start of pic macro */
  509. X***************
  510. X*** 128,134
  511. X          }
  512. X      if (coord_system == 2) CONV = 1;
  513. X  
  514. X!     fprintf(tfp, ".PS\n");    /* PostScript magic strings */
  515. X  
  516. X      for (a = objects->arcs; a != NULL; a = a->next) genpic_arc(a);
  517. X      for (c = objects->compounds; c != NULL; c = c->next) genpic_compound(c);
  518. X
  519. X--- 145,151 -----
  520. X      }
  521. X      if (coord_system == 2) CONV = 1;
  522. X  
  523. X!     fprintf(tfp, ".PS\n");    /* start of pic macro */
  524. X  
  525. X      for (a = objects->arcs; a != NULL; a = a->next) genpic_arc(a);
  526. X      for (c = objects->compounds; c != NULL; c = c->next) genpic_compound(c);
  527. X***************
  528. X*** 136,141
  529. X      for (l = objects->lines; l != NULL; l = l->next) genpic_line(l);
  530. X      for (s = objects->splines; s != NULL; s = s->next) genpic_spline(s);
  531. X      for (t = objects->texts; t != NULL; t = t->next) genpic_text(t);
  532. X      fprintf(tfp, ".PE\n");
  533. X      }
  534. X  
  535. X
  536. X--- 153,162 -----
  537. X      for (l = objects->lines; l != NULL; l = l->next) genpic_line(l);
  538. X      for (s = objects->splines; s != NULL; s = s->next) genpic_spline(s);
  539. X      for (t = objects->texts; t != NULL; t = t->next) genpic_text(t);
  540. X+     if(dotps)
  541. X+         fprintf(tfp, ".ps\n");    /* back to initial point size */
  542. X+     if(dotft)
  543. X+         fprintf(tfp, ".ft\n");    /* back to initial font */
  544. X      fprintf(tfp, ".PE\n");
  545. X  }
  546. X  
  547. X***************
  548. X*** 137,143
  549. X      for (s = objects->splines; s != NULL; s = s->next) genpic_spline(s);
  550. X      for (t = objects->texts; t != NULL; t = t->next) genpic_text(t);
  551. X      fprintf(tfp, ".PE\n");
  552. X!     }
  553. X  
  554. X  /*
  555. X  The line thickness is, unfortunately, multiple of pixel.
  556. X
  557. X--- 158,164 -----
  558. X      if(dotft)
  559. X          fprintf(tfp, ".ft\n");    /* back to initial font */
  560. X      fprintf(tfp, ".PE\n");
  561. X! }
  562. X  
  563. X  /*
  564. X  ** linewidth can be controlled with pointsize, but this means we have
  565. X***************
  566. X*** 140,152
  567. X      }
  568. X  
  569. X  /*
  570. X! The line thickness is, unfortunately, multiple of pixel.
  571. X! One pixel thickness is a little too thick on the hard copy
  572. X! so I scale it with 0.7; i.e., it's a kludge.  The best way is
  573. X! to allow thickness in fraction of pixel.
  574. X! 
  575. X! Note that the current version of psdit (a ditroff to postcript filter)
  576. X! won't take the legitimate line thickness command.
  577. X  */
  578. X  set_linewidth(w)
  579. X  int    w;
  580. X
  581. X--- 161,169 -----
  582. X  }
  583. X  
  584. X  /*
  585. X! ** linewidth can be controlled with pointsize, but this means we have
  586. X! ** to be rigorous about using a .ps (null) every time, so a real point size
  587. X! ** request can revert to previous size
  588. X  */
  589. X  set_linewidth(w)
  590. X  int    w;
  591. X***************
  592. X*** 151,157
  593. X  set_linewidth(w)
  594. X  int    w;
  595. X  {
  596. X!     static int    cur_thickness = -1;
  597. X  
  598. X      /*
  599. X      if (w == 0) return;
  600. X
  601. X--- 168,176 -----
  602. X  set_linewidth(w)
  603. X  int    w;
  604. X  {
  605. X!     if (w == 0 || w*10 == dotps) return;
  606. X!     fprintf(tfp,".ps\n.ps %d\n",dotps = 10*w);
  607. X! }
  608. X  
  609. X  set_style(s, v)
  610. X  int    s;
  611. X***************
  612. X*** 153,167
  613. X  {
  614. X      static int    cur_thickness = -1;
  615. X  
  616. X-     /*
  617. X-     if (w == 0) return;
  618. X-     if (w != cur_thickness) {
  619. X-         cur_thickness = w;
  620. X-         fprintf(tfp, "\"\\D't %.5fi'\"\n", 0.7 * cur_thickness / ppi);
  621. X-         }
  622. X-     */
  623. X-     }
  624. X- 
  625. X  set_style(s, v)
  626. X  int    s;
  627. X  float    v;
  628. X
  629. X--- 172,177 -----
  630. X      fprintf(tfp,".ps\n.ps %d\n",dotps = 10*w);
  631. X  }
  632. X  
  633. X  set_style(s, v)
  634. X  int    s;
  635. X  float    v;
  636. X***************
  637. X*** 168,179
  638. X  {
  639. X      static float    style_val = -1;
  640. X  
  641. X!     if (s == DASH_LINE || s == DOTTED_LINE) {
  642. X!         if (v == style_val) return;
  643. X!         if (v == 0.0) return;
  644. X!         style_val = v;
  645. X!         fprintf(tfp, "dashwid = %.3fi\n", style_val/ppi);
  646. X!         }
  647. X      }
  648. X  
  649. X  genpic_compound(com)
  650. X
  651. X--- 178,189 -----
  652. X  {
  653. X      static float    style_val = -1;
  654. X  
  655. X!     if (s == DASH_LINE || s == DOTTED_LINE)
  656. X!     {
  657. X!         if (v == style_val) return;
  658. X!         if (v == 0.0) return;
  659. X!         style_val = v;
  660. X!         fprintf(tfp, "dashwid = %.3fi\n", style_val/ppi);
  661. X      }
  662. X  }
  663. X  
  664. X***************
  665. X*** 175,180
  666. X          fprintf(tfp, "dashwid = %.3fi\n", style_val/ppi);
  667. X          }
  668. X      }
  669. X  
  670. X  genpic_compound(com)
  671. X  F_compound    *com;
  672. X
  673. X--- 185,191 -----
  674. X          style_val = v;
  675. X          fprintf(tfp, "dashwid = %.3fi\n", style_val/ppi);
  676. X      }
  677. X+ }
  678. X  
  679. X  genpic_compound(com)
  680. X  F_compound    *com;
  681. X***************
  682. X*** 192,198
  683. X      for (l = com->lines; l != NULL; l = l->next) genpic_line(l);
  684. X      for (s = com->splines; s != NULL; s = s->next) genpic_spline(s);
  685. X      for (t = com->texts; t != NULL; t = t->next) genpic_text(t);
  686. X!     }
  687. X  
  688. X  genpic_line(l)
  689. X  F_line    *l;
  690. X
  691. X--- 203,209 -----
  692. X      for (l = com->lines; l != NULL; l = l->next) genpic_line(l);
  693. X      for (s = com->splines; s != NULL; s = s->next) genpic_spline(s);
  694. X      for (t = com->texts; t != NULL; t = t->next) genpic_text(t);
  695. X! }
  696. X  
  697. X  genpic_line(l)
  698. X  F_line    *l;
  699. X***************
  700. X*** 203,213
  701. X      set_style(l->style, l->style_val);
  702. X      p = l->points;
  703. X      q = p->next;
  704. X!     if (q == NULL) { /* A single point line */
  705. X!         fprintf(tfp, "line from %.3f,%.3f to %.3f,%.3f\n",
  706. X!             p->x/ppi, convy(p->y/ppi), p->x/ppi, convy(p->y/ppi));
  707. X!         return;
  708. X!         }
  709. X      if (l->back_arrow)
  710. X          draw_arrow_head(q->x/ppi, convy(q->y/ppi), p->x/ppi,
  711. X          convy(p->y/ppi), l->back_arrow->ht/ppi, l->back_arrow->wid/ppi);
  712. X
  713. X--- 214,225 -----
  714. X      set_style(l->style, l->style_val);
  715. X      p = l->points;
  716. X      q = p->next;
  717. X!     if (q == NULL)
  718. X!     { /* A single point line */
  719. X!         fprintf(tfp, "line from %.3f,%.3f to %.3f,%.3f\n",
  720. X!         p->x/ppi, convy(p->y/ppi), p->x/ppi, convy(p->y/ppi));
  721. X!         return;
  722. X!     }
  723. X      if (l->back_arrow)
  724. X          draw_arrow_head(q->x/ppi, convy(q->y/ppi), p->x/ppi,
  725. X          convy(p->y/ppi), l->back_arrow->ht/ppi, l->back_arrow->wid/ppi);
  726. X***************
  727. X*** 209,215
  728. X          return;
  729. X          }
  730. X      if (l->back_arrow)
  731. X!         draw_arrow_head(q->x/ppi, convy(q->y/ppi), p->x/ppi,
  732. X          convy(p->y/ppi), l->back_arrow->ht/ppi, l->back_arrow->wid/ppi);
  733. X      if (l->style == DASH_LINE && l->style_val > 0.0)
  734. X          fprintf(tfp, "line dashed from");
  735. X
  736. X--- 221,227 -----
  737. X          return;
  738. X      }
  739. X      if (l->back_arrow)
  740. X!         draw_arrow_head(q->x/ppi, convy(q->y/ppi), p->x/ppi,
  741. X          convy(p->y/ppi), l->back_arrow->ht/ppi, l->back_arrow->wid/ppi);
  742. X      if (l->style == DASH_LINE && l->style_val > 0.0)
  743. X          fprintf(tfp, "line dashed from");
  744. X***************
  745. X*** 212,218
  746. X          draw_arrow_head(q->x/ppi, convy(q->y/ppi), p->x/ppi,
  747. X          convy(p->y/ppi), l->back_arrow->ht/ppi, l->back_arrow->wid/ppi);
  748. X      if (l->style == DASH_LINE && l->style_val > 0.0)
  749. X!         fprintf(tfp, "line dashed from");
  750. X      else if (l->style == DOTTED_LINE && l->style_val > 0.0)
  751. X          fprintf(tfp, "line dotted from");
  752. X      else
  753. X
  754. X--- 224,230 -----
  755. X          draw_arrow_head(q->x/ppi, convy(q->y/ppi), p->x/ppi,
  756. X          convy(p->y/ppi), l->back_arrow->ht/ppi, l->back_arrow->wid/ppi);
  757. X      if (l->style == DASH_LINE && l->style_val > 0.0)
  758. X!         fprintf(tfp, "line dashed from");
  759. X      else if (l->style == DOTTED_LINE && l->style_val > 0.0)
  760. X          fprintf(tfp, "line dotted from");
  761. X      else
  762. X***************
  763. X*** 214,220
  764. X      if (l->style == DASH_LINE && l->style_val > 0.0)
  765. X          fprintf(tfp, "line dashed from");
  766. X      else if (l->style == DOTTED_LINE && l->style_val > 0.0)
  767. X!         fprintf(tfp, "line dotted from");
  768. X      else
  769. X          fprintf(tfp, "line from");
  770. X      fprintf(tfp, " %.3f,%.3f to", p->x/ppi, convy(p->y/ppi));
  771. X
  772. X--- 226,232 -----
  773. X      if (l->style == DASH_LINE && l->style_val > 0.0)
  774. X          fprintf(tfp, "line dashed from");
  775. X      else if (l->style == DOTTED_LINE && l->style_val > 0.0)
  776. X!         fprintf(tfp, "line dotted from");
  777. X      else
  778. X          fprintf(tfp, "line from");
  779. X      fprintf(tfp, " %.3f,%.3f to", p->x/ppi, convy(p->y/ppi));
  780. X***************
  781. X*** 216,222
  782. X      else if (l->style == DOTTED_LINE && l->style_val > 0.0)
  783. X          fprintf(tfp, "line dotted from");
  784. X      else
  785. X!         fprintf(tfp, "line from");
  786. X      fprintf(tfp, " %.3f,%.3f to", p->x/ppi, convy(p->y/ppi));
  787. X      while (q->next != NULL) {
  788. X          p = q;
  789. X
  790. X--- 228,234 -----
  791. X      else if (l->style == DOTTED_LINE && l->style_val > 0.0)
  792. X          fprintf(tfp, "line dotted from");
  793. X      else
  794. X!         fprintf(tfp, "line from");
  795. X      fprintf(tfp, " %.3f,%.3f to", p->x/ppi, convy(p->y/ppi));
  796. X      while (q->next != NULL)
  797. X      {
  798. X***************
  799. X*** 218,228
  800. X      else
  801. X          fprintf(tfp, "line from");
  802. X      fprintf(tfp, " %.3f,%.3f to", p->x/ppi, convy(p->y/ppi));
  803. X!     while (q->next != NULL) {
  804. X!         p = q;
  805. X!         q = q->next;
  806. X!         fprintf(tfp, " %.3f,%.3f to", p->x/ppi, convy(p->y/ppi));
  807. X!         }
  808. X      fprintf(tfp, " %.3f,%.3f\n", q->x/ppi, convy(q->y/ppi));
  809. X      if (l->for_arrow)
  810. X          draw_arrow_head(p->x/ppi, convy(p->y/ppi), q->x/ppi,
  811. X
  812. X--- 230,241 -----
  813. X      else
  814. X          fprintf(tfp, "line from");
  815. X      fprintf(tfp, " %.3f,%.3f to", p->x/ppi, convy(p->y/ppi));
  816. X!     while (q->next != NULL)
  817. X!     {
  818. X!         p = q;
  819. X!         q = q->next;
  820. X!         fprintf(tfp, " %.3f,%.3f to", p->x/ppi, convy(p->y/ppi));
  821. X!     }
  822. X      fprintf(tfp, " %.3f,%.3f\n", q->x/ppi, convy(q->y/ppi));
  823. X      if (l->for_arrow)
  824. X          draw_arrow_head(p->x/ppi, convy(p->y/ppi), q->x/ppi,
  825. X***************
  826. X*** 225,231
  827. X          }
  828. X      fprintf(tfp, " %.3f,%.3f\n", q->x/ppi, convy(q->y/ppi));
  829. X      if (l->for_arrow)
  830. X!         draw_arrow_head(p->x/ppi, convy(p->y/ppi), q->x/ppi,
  831. X          convy(q->y/ppi), l->for_arrow->ht/ppi, l->for_arrow->wid/ppi);
  832. X      }
  833. X  
  834. X
  835. X--- 238,244 -----
  836. X      }
  837. X      fprintf(tfp, " %.3f,%.3f\n", q->x/ppi, convy(q->y/ppi));
  838. X      if (l->for_arrow)
  839. X!         draw_arrow_head(p->x/ppi, convy(p->y/ppi), q->x/ppi,
  840. X          convy(q->y/ppi), l->for_arrow->ht/ppi, l->for_arrow->wid/ppi);
  841. X  }
  842. X  
  843. X***************
  844. X*** 227,233
  845. X      if (l->for_arrow)
  846. X          draw_arrow_head(p->x/ppi, convy(p->y/ppi), q->x/ppi,
  847. X          convy(q->y/ppi), l->for_arrow->ht/ppi, l->for_arrow->wid/ppi);
  848. X!     }
  849. X  
  850. X  genpic_spline(s)
  851. X  F_spline    *s;
  852. X
  853. X--- 240,246 -----
  854. X      if (l->for_arrow)
  855. X          draw_arrow_head(p->x/ppi, convy(p->y/ppi), q->x/ppi,
  856. X          convy(q->y/ppi), l->for_arrow->ht/ppi, l->for_arrow->wid/ppi);
  857. X! }
  858. X  
  859. X  genpic_spline(s)
  860. X  F_spline    *s;
  861. X***************
  862. X*** 232,237
  863. X  genpic_spline(s)
  864. X  F_spline    *s;
  865. X  {
  866. X      if (int_spline(s))
  867. X          genpic_itp_spline(s);
  868. X      else
  869. X
  870. X--- 245,251 -----
  871. X  genpic_spline(s)
  872. X  F_spline    *s;
  873. X  {
  874. X+     set_linewidth(s->thickness);
  875. X      if (int_spline(s))
  876. X          genpic_itp_spline(s);
  877. X      else
  878. X***************
  879. X*** 233,239
  880. X  F_spline    *s;
  881. X  {
  882. X      if (int_spline(s))
  883. X!         genpic_itp_spline(s);
  884. X      else
  885. X          genpic_ctl_spline(s);
  886. X      }
  887. X
  888. X--- 247,253 -----
  889. X  {
  890. X      set_linewidth(s->thickness);
  891. X      if (int_spline(s))
  892. X!         genpic_itp_spline(s);
  893. X      else
  894. X          genpic_ctl_spline(s);
  895. X  }
  896. X***************
  897. X*** 235,242
  898. X      if (int_spline(s))
  899. X          genpic_itp_spline(s);
  900. X      else
  901. X!         genpic_ctl_spline(s);
  902. X!     }
  903. X  
  904. X  genpic_ctl_spline(s)
  905. X  F_spline    *s;
  906. X
  907. X--- 249,256 -----
  908. X      if (int_spline(s))
  909. X          genpic_itp_spline(s);
  910. X      else
  911. X!         genpic_ctl_spline(s);
  912. X! }
  913. X  
  914. X  genpic_ctl_spline(s)
  915. X  F_spline    *s;
  916. X***************
  917. X*** 242,248
  918. X  F_spline    *s;
  919. X  {
  920. X      if (closed_spline(s))
  921. X!         genpic_closed_spline(s);
  922. X      else
  923. X          genpic_open_spline(s);
  924. X      }
  925. X
  926. X--- 256,262 -----
  927. X  F_spline    *s;
  928. X  {
  929. X      if (closed_spline(s))
  930. X!         genpic_closed_spline(s);
  931. X      else
  932. X          genpic_open_spline(s);
  933. X  }
  934. X***************
  935. X*** 244,251
  936. X      if (closed_spline(s))
  937. X          genpic_closed_spline(s);
  938. X      else
  939. X!         genpic_open_spline(s);
  940. X!     }
  941. X  
  942. X  genpic_open_spline(s)
  943. X  F_spline    *s;
  944. X
  945. X--- 258,265 -----
  946. X      if (closed_spline(s))
  947. X          genpic_closed_spline(s);
  948. X      else
  949. X!         genpic_open_spline(s);
  950. X! }
  951. X  
  952. X  genpic_open_spline(s)
  953. X  F_spline    *s;
  954. X***************
  955. X*** 254,260
  956. X      F_point        *p, *q;
  957. X  
  958. X      p = s->points;
  959. X!     x1 = p->x/ppi; y1 = convy(p->y/ppi);
  960. X      p = p->next;
  961. X      x2 = p->x/ppi; y2 = convy(p->y/ppi);
  962. X  
  963. X
  964. X--- 268,275 -----
  965. X      F_point        *p, *q;
  966. X  
  967. X      p = s->points;
  968. X!     x1 = p->x/ppi; 
  969. X!     y1 = convy(p->y/ppi);
  970. X      p = p->next;
  971. X      x2 = p->x/ppi; 
  972. X      y2 = convy(p->y/ppi);
  973. X***************
  974. X*** 256,262
  975. X      p = s->points;
  976. X      x1 = p->x/ppi; y1 = convy(p->y/ppi);
  977. X      p = p->next;
  978. X!     x2 = p->x/ppi; y2 = convy(p->y/ppi);
  979. X  
  980. X      if (s->back_arrow)
  981. X          draw_arrow_head(x2, y2, x1, y1,
  982. X
  983. X--- 271,278 -----
  984. X      x1 = p->x/ppi; 
  985. X      y1 = convy(p->y/ppi);
  986. X      p = p->next;
  987. X!     x2 = p->x/ppi; 
  988. X!     y2 = convy(p->y/ppi);
  989. X  
  990. X      if (s->back_arrow)
  991. X          draw_arrow_head(x2, y2, x1, y1,
  992. X***************
  993. X*** 259,265
  994. X      x2 = p->x/ppi; y2 = convy(p->y/ppi);
  995. X  
  996. X      if (s->back_arrow)
  997. X!         draw_arrow_head(x2, y2, x1, y1,
  998. X          s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  999. X  
  1000. X      /* Pic's spline supports only solid line style */
  1001. X
  1002. X--- 275,281 -----
  1003. X      y2 = convy(p->y/ppi);
  1004. X  
  1005. X      if (s->back_arrow)
  1006. X!         draw_arrow_head(x2, y2, x1, y1,
  1007. X          s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  1008. X  
  1009. X      /* Pic's spline supports only solid line style */
  1010. X***************
  1011. X*** 263,269
  1012. X          s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  1013. X  
  1014. X      /* Pic's spline supports only solid line style */
  1015. X-     /* set_linewidth(s->thickness); */
  1016. X  
  1017. X      if (p->next == NULL) {
  1018. X          fprintf(tfp, "line from %.3f,%.3f to %.3f,%.3f\n", x1, y1, x2, y2);
  1019. X
  1020. X--- 279,284 -----
  1021. X          s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  1022. X  
  1023. X      /* Pic's spline supports only solid line style */
  1024. X  
  1025. X      if (p->next == NULL)
  1026. X      {
  1027. X***************
  1028. X*** 265,277
  1029. X      /* Pic's spline supports only solid line style */
  1030. X      /* set_linewidth(s->thickness); */
  1031. X  
  1032. X!     if (p->next == NULL) {
  1033. X!         fprintf(tfp, "line from %.3f,%.3f to %.3f,%.3f\n", x1, y1, x2, y2);
  1034. X!         if (s->for_arrow)
  1035. X!         draw_arrow_head(x1, y1, x2, y2, s->for_arrow->ht/ppi,
  1036. X!                 s->for_arrow->wid/ppi);
  1037. X!         return;
  1038. X!         }
  1039. X  
  1040. X      fprintf(tfp, "spline from %.3f,%.3f to %.3f,%.3f", x1, y1, x2, y2);
  1041. X  
  1042. X
  1043. X--- 280,293 -----
  1044. X  
  1045. X      /* Pic's spline supports only solid line style */
  1046. X  
  1047. X!     if (p->next == NULL)
  1048. X!     {
  1049. X!         fprintf(tfp, "line from %.3f,%.3f to %.3f,%.3f\n", x1, y1, x2, y2);
  1050. X!         if (s->for_arrow)
  1051. X!             draw_arrow_head(x1, y1, x2, y2, s->for_arrow->ht/ppi,
  1052. X!             s->for_arrow->wid/ppi);
  1053. X!         return;
  1054. X!     }
  1055. X  
  1056. X      fprintf(tfp, "spline from %.3f,%.3f to %.3f,%.3f", x1, y1, x2, y2);
  1057. X  
  1058. X***************
  1059. X*** 276,282
  1060. X      fprintf(tfp, "spline from %.3f,%.3f to %.3f,%.3f", x1, y1, x2, y2);
  1061. X  
  1062. X      for (q = p->next; q->next != NULL; p = q, q = q->next)
  1063. X!         fprintf(tfp, " to %.3f,%.3f", q->x/ppi, convy(q->y/ppi));
  1064. X      fprintf(tfp, " to %.3f,%.3f\n", (x2=q->x/ppi), (y2=convy(q->y/ppi)));
  1065. X  
  1066. X      if (s->for_arrow)
  1067. X
  1068. X--- 292,298 -----
  1069. X      fprintf(tfp, "spline from %.3f,%.3f to %.3f,%.3f", x1, y1, x2, y2);
  1070. X  
  1071. X      for (q = p->next; q->next != NULL; p = q, q = q->next)
  1072. X!         fprintf(tfp, " to %.3f,%.3f", q->x/ppi, convy(q->y/ppi));
  1073. X      fprintf(tfp, " to %.3f,%.3f\n", (x2=q->x/ppi), (y2=convy(q->y/ppi)));
  1074. X  
  1075. X      if (s->for_arrow)
  1076. X***************
  1077. X*** 280,286
  1078. X      fprintf(tfp, " to %.3f,%.3f\n", (x2=q->x/ppi), (y2=convy(q->y/ppi)));
  1079. X  
  1080. X      if (s->for_arrow)
  1081. X!         draw_arrow_head(p->x/ppi, convy(p->y/ppi), x2, y2,
  1082. X          s->for_arrow->ht/ppi, s->for_arrow->wid/ppi);
  1083. X      }
  1084. X  
  1085. X
  1086. X--- 296,302 -----
  1087. X      fprintf(tfp, " to %.3f,%.3f\n", (x2=q->x/ppi), (y2=convy(q->y/ppi)));
  1088. X  
  1089. X      if (s->for_arrow)
  1090. X!         draw_arrow_head(p->x/ppi, convy(p->y/ppi), x2, y2,
  1091. X          s->for_arrow->ht/ppi, s->for_arrow->wid/ppi);
  1092. X  }
  1093. X  
  1094. X***************
  1095. X*** 282,288
  1096. X      if (s->for_arrow)
  1097. X          draw_arrow_head(p->x/ppi, convy(p->y/ppi), x2, y2,
  1098. X          s->for_arrow->ht/ppi, s->for_arrow->wid/ppi);
  1099. X!     }
  1100. X  
  1101. X  genpic_ellipse(e)
  1102. X  F_ellipse    *e;
  1103. X
  1104. X--- 298,304 -----
  1105. X      if (s->for_arrow)
  1106. X          draw_arrow_head(p->x/ppi, convy(p->y/ppi), x2, y2,
  1107. X          s->for_arrow->ht/ppi, s->for_arrow->wid/ppi);
  1108. X! }
  1109. X  
  1110. X  genpic_ellipse(e)
  1111. X  F_ellipse    *e;
  1112. X***************
  1113. X*** 289,297
  1114. X  {
  1115. X      set_linewidth(e->thickness);
  1116. X      fprintf(tfp, "ellipse at %.3f,%.3f wid %.3f ht %.3f\n",
  1117. X!         e->center.x/ppi, convy(e->center.y/ppi),
  1118. X!         2 * e->radiuses.x/ppi, 2 * e->radiuses.y/ppi);
  1119. X!     }
  1120. X  
  1121. X  /*
  1122. X  Text is display on the screen with the base line starting at
  1123. X
  1124. X--- 305,313 -----
  1125. X  {
  1126. X      set_linewidth(e->thickness);
  1127. X      fprintf(tfp, "ellipse at %.3f,%.3f wid %.3f ht %.3f\n",
  1128. X!     e->center.x/ppi, convy(e->center.y/ppi),
  1129. X!     2 * e->radiuses.x/ppi, 2 * e->radiuses.y/ppi);
  1130. X! }
  1131. X  
  1132. X  /*
  1133. X  Text is display on the screen with the base line starting at
  1134. X***************
  1135. X*** 307,313
  1136. X  F_text    *t;
  1137. X  {
  1138. X      float    y;
  1139. X!     int    first = 1;
  1140. X  
  1141. X      if (first) {
  1142. X          first = 0;
  1143. X
  1144. X--- 323,330 -----
  1145. X  F_text    *t;
  1146. X  {
  1147. X      float    y;
  1148. X!     static    char fontcode[NUMFONTS][3];
  1149. X!     int    i;
  1150. X  
  1151. X      if(fontcode[t->font][0] == '\0')
  1152. X          for(i=0; *troff_fonts[i].lwname != '\0'; i++)
  1153. X***************
  1154. X*** 309,318
  1155. X      float    y;
  1156. X      int    first = 1;
  1157. X  
  1158. X!     if (first) {
  1159. X!         first = 0;
  1160. X!         fprintf(tfp, ".ps %d\n", font_size);
  1161. X!         }
  1162. X  
  1163. X      y = convy(t->base_y/ppi) + font_size * HT_OFFSET;
  1164. X      fprintf(tfp, "\"%s\" at %.3f,%.3f ljust\n",
  1165. X
  1166. X--- 326,342 -----
  1167. X      static    char fontcode[NUMFONTS][3];
  1168. X      int    i;
  1169. X  
  1170. X!     if(fontcode[t->font][0] == '\0')
  1171. X!         for(i=0; *troff_fonts[i].lwname != '\0'; i++)
  1172. X!         {
  1173. X!             if(strcmp(troff_fonts[i].lwname,fontnames[t->font].psfont)==0)
  1174. X!             {
  1175. X!                 strncpy(&fontcode[t->font][0],troff_fonts[i].trname,2);
  1176. X!                 break;
  1177. X!             }
  1178. X!         }
  1179. X!     if(fontcode[t->font][0] == '\0')
  1180. X!         fontcode[t->font][0] = 'R';    /* default */
  1181. X  
  1182. X      if(t->size != dotps)
  1183. X          fprintf(tfp, ".ps\n.ps %d\n", dotps = t->size);
  1184. X***************
  1185. X*** 314,322
  1186. X          fprintf(tfp, ".ps %d\n", font_size);
  1187. X          }
  1188. X  
  1189. X!     y = convy(t->base_y/ppi) + font_size * HT_OFFSET;
  1190. X!     fprintf(tfp, "\"%s\" at %.3f,%.3f ljust\n",
  1191. X!         t->cstring, t->base_x/ppi, y);
  1192. X      }
  1193. X  
  1194. X  genpic_arc(a)
  1195. X
  1196. X--- 338,349 -----
  1197. X      if(fontcode[t->font][0] == '\0')
  1198. X          fontcode[t->font][0] = 'R';    /* default */
  1199. X  
  1200. X!     if(t->size != dotps)
  1201. X!         fprintf(tfp, ".ps\n.ps %d\n", dotps = t->size);
  1202. X!     if(t->font != dotft - 1)
  1203. X!     {
  1204. X!         fprintf(tfp, ".ft\n.ft %s\n", &fontcode[t->font][0]);
  1205. X!         dotft = t->font + 1;
  1206. X      }
  1207. X  
  1208. X      y = convy(t->base_y/ppi) + t->size * HT_OFFSET;
  1209. X***************
  1210. X*** 319,324
  1211. X          t->cstring, t->base_x/ppi, y);
  1212. X      }
  1213. X  
  1214. X  genpic_arc(a)
  1215. X  F_arc    *a;
  1216. X  {
  1217. X
  1218. X--- 346,368 -----
  1219. X          dotft = t->font + 1;
  1220. X      }
  1221. X  
  1222. X+     y = convy(t->base_y/ppi) + t->size * HT_OFFSET;
  1223. X+     fprintf(tfp, "\"%s\" at %.3f,%.3f",
  1224. X+     t->cstring, t->base_x/ppi, y);
  1225. X+ 
  1226. X+     switch(t->type)
  1227. X+     {
  1228. X+     case T_RIGHT_JUSTIFIED:
  1229. X+         fprintf(tfp, " rjust\n");
  1230. X+         break;
  1231. X+     case T_LEFT_JUSTIFIED:
  1232. X+         fprintf(tfp, " ljust\n");
  1233. X+         break;
  1234. X+     default:
  1235. X+         putc('\n',tfp);
  1236. X+     }
  1237. X+ }
  1238. X+ 
  1239. X  genpic_arc(a)
  1240. X  F_arc    *a;
  1241. X  {
  1242. X***************
  1243. X*** 325,333
  1244. X      double        x, y;
  1245. X      double        cx, cy, sx, sy, ex, ey;
  1246. X  
  1247. X!     cx = a->center.x/ppi; cy = convy(a->center.y/ppi);
  1248. X!     sx = a->point[0].x/ppi; sy = convy(a->point[0].y/ppi);
  1249. X!     ex = a->point[2].x/ppi; ey = convy(a->point[2].y/ppi);
  1250. X  
  1251. X      set_linewidth(a->thickness);
  1252. X  
  1253. X
  1254. X--- 369,380 -----
  1255. X      double        x, y;
  1256. X      double        cx, cy, sx, sy, ex, ey;
  1257. X  
  1258. X!     cx = a->center.x/ppi; 
  1259. X!     cy = convy(a->center.y/ppi);
  1260. X!     sx = a->point[0].x/ppi; 
  1261. X!     sy = convy(a->point[0].y/ppi);
  1262. X!     ex = a->point[2].x/ppi; 
  1263. X!     ey = convy(a->point[2].y/ppi);
  1264. X  
  1265. X      set_linewidth(a->thickness);
  1266. X  
  1267. X***************
  1268. X*** 331,346
  1269. X  
  1270. X      set_linewidth(a->thickness);
  1271. X  
  1272. X!     if (a->for_arrow) {
  1273. X!         arc_tangent(cx, cy, ex, ey, a->direction, &x, &y);
  1274. X!         draw_arrow_head(x, y, ex, ey,
  1275. X!             a->for_arrow->ht/ppi, a->for_arrow->wid/ppi);
  1276. X!         }
  1277. X!     if (a->back_arrow) {
  1278. X!         arc_tangent(cx, cy, sx, sy, !a->direction, &x, &y);
  1279. X!         draw_arrow_head(x, y, sx, sy,
  1280. X!             a->back_arrow->ht/ppi, a->back_arrow->wid/ppi);
  1281. X!         }
  1282. X  
  1283. X      if (a->direction)
  1284. X          fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f\n",
  1285. X
  1286. X--- 378,395 -----
  1287. X  
  1288. X      set_linewidth(a->thickness);
  1289. X  
  1290. X!     if (a->for_arrow)
  1291. X!     {
  1292. X!         arc_tangent(cx, cy, ex, ey, a->direction, &x, &y);
  1293. X!         draw_arrow_head(x, y, ex, ey,
  1294. X!         a->for_arrow->ht/ppi, a->for_arrow->wid/ppi);
  1295. X!     }
  1296. X!     if (a->back_arrow)
  1297. X!     {
  1298. X!         arc_tangent(cx, cy, sx, sy, !a->direction, &x, &y);
  1299. X!         draw_arrow_head(x, y, sx, sy,
  1300. X!         a->back_arrow->ht/ppi, a->back_arrow->wid/ppi);
  1301. X!     }
  1302. X  
  1303. X      if (a->direction)
  1304. X          fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f\n",
  1305. X***************
  1306. X*** 343,350
  1307. X          }
  1308. X  
  1309. X      if (a->direction)
  1310. X!         fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f\n",
  1311. X!             cx, cy, sx, sy, ex, ey);
  1312. X      else
  1313. X          fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f cw\n",
  1314. X              cx, cy, sx, sy, ex, ey);
  1315. X
  1316. X--- 392,399 -----
  1317. X      }
  1318. X  
  1319. X      if (a->direction)
  1320. X!         fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f\n",
  1321. X!         cx, cy, sx, sy, ex, ey);
  1322. X      else
  1323. X          fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f cw\n",
  1324. X          cx, cy, sx, sy, ex, ey);
  1325. X***************
  1326. X*** 346,353
  1327. X          fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f\n",
  1328. X              cx, cy, sx, sy, ex, ey);
  1329. X      else
  1330. X!         fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f cw\n",
  1331. X!             cx, cy, sx, sy, ex, ey);
  1332. X  
  1333. X      }
  1334. X  
  1335. X
  1336. X--- 395,402 -----
  1337. X          fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f\n",
  1338. X          cx, cy, sx, sy, ex, ey);
  1339. X      else
  1340. X!         fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f cw\n",
  1341. X!         cx, cy, sx, sy, ex, ey);
  1342. X  
  1343. X  }
  1344. X  
  1345. X***************
  1346. X*** 349,355
  1347. X          fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f cw\n",
  1348. X              cx, cy, sx, sy, ex, ey);
  1349. X  
  1350. X!     }
  1351. X  
  1352. X  arc_tangent(x1, y1, x2, y2, direction, x, y)
  1353. X  double    x1, y1, x2, y2, *x, *y;
  1354. X
  1355. X--- 398,404 -----
  1356. X          fprintf(tfp, "arc at %.3f,%.3f from %.3f,%.3f to %.3f,%.3f cw\n",
  1357. X          cx, cy, sx, sy, ex, ey);
  1358. X  
  1359. X! }
  1360. X  
  1361. X  arc_tangent(x1, y1, x2, y2, direction, x, y)
  1362. X  double    x1, y1, x2, y2, *x, *y;
  1363. X***************
  1364. X*** 355,368
  1365. X  double    x1, y1, x2, y2, *x, *y;
  1366. X  int    direction;
  1367. X  {
  1368. X!     if (direction) { /* counter clockwise  */
  1369. X!         *x = x2 + (y2 - y1);
  1370. X!         *y = y2 - (x2 - x1);
  1371. X!         }
  1372. X!     else {
  1373. X!         *x = x2 - (y2 - y1);
  1374. X!         *y = y2 + (x2 - x1);
  1375. X!         }
  1376. X      }
  1377. X  
  1378. X  /*    draw arrow heading from (x1, y1) to (x2, y2)    */
  1379. X
  1380. X--- 404,413 -----
  1381. X  double    x1, y1, x2, y2, *x, *y;
  1382. X  int    direction;
  1383. X  {
  1384. X!     if (direction)
  1385. X!     { /* counter clockwise  */
  1386. X!         *x = x2 + (y2 - y1);
  1387. X!         *y = y2 - (x2 - x1);
  1388. X      }
  1389. X      else
  1390. X      {
  1391. X***************
  1392. X*** 364,369
  1393. X          *y = y2 + (x2 - x1);
  1394. X          }
  1395. X      }
  1396. X  
  1397. X  /*    draw arrow heading from (x1, y1) to (x2, y2)    */
  1398. X  
  1399. X
  1400. X--- 409,420 -----
  1401. X          *x = x2 + (y2 - y1);
  1402. X          *y = y2 - (x2 - x1);
  1403. X      }
  1404. X+     else
  1405. X+     {
  1406. X+         *x = x2 - (y2 - y1);
  1407. X+         *y = y2 + (x2 - x1);
  1408. X+     }
  1409. X+ }
  1410. X  
  1411. X  /*    draw arrow heading from (x1, y1) to (x2, y2)    */
  1412. X  
  1413. X***************
  1414. X*** 373,379
  1415. X      double    x, y, xb, yb, dx, dy, l, sina, cosa;
  1416. X      double    xc, yc, xd, yd;
  1417. X  
  1418. X!     dx = x2 - x1;  dy = y1 - y2;
  1419. X      l = sqrt((dx*dx + dy*dy));
  1420. X      sina = dy / l;  cosa = dx / l;
  1421. X      xb = x2*cosa - y2*sina;
  1422. X
  1423. X--- 424,431 -----
  1424. X      double    x, y, xb, yb, dx, dy, l, sina, cosa;
  1425. X      double    xc, yc, xd, yd;
  1426. X  
  1427. X!     dx = x2 - x1;  
  1428. X!     dy = y1 - y2;
  1429. X      l = sqrt((dx*dx + dy*dy));
  1430. X      sina = dy / l;  
  1431. X      cosa = dx / l;
  1432. X***************
  1433. X*** 375,381
  1434. X  
  1435. X      dx = x2 - x1;  dy = y1 - y2;
  1436. X      l = sqrt((dx*dx + dy*dy));
  1437. X!     sina = dy / l;  cosa = dx / l;
  1438. X      xb = x2*cosa - y2*sina;
  1439. X      yb = x2*sina + y2*cosa;
  1440. X      x = xb - arrowht;
  1441. X
  1442. X--- 427,434 -----
  1443. X      dx = x2 - x1;  
  1444. X      dy = y1 - y2;
  1445. X      l = sqrt((dx*dx + dy*dy));
  1446. X!     sina = dy / l;  
  1447. X!     cosa = dx / l;
  1448. X      xb = x2*cosa - y2*sina;
  1449. X      yb = x2*sina + y2*cosa;
  1450. X      x = xb - arrowht;
  1451. X***************
  1452. X*** 386,393
  1453. X      xd = x*cosa + y*sina;
  1454. X      yd = -x*sina + y*cosa;
  1455. X      fprintf(tfp, "line from %.3f,%.3f to %.3f,%.3f to %.3f,%.3f\n",
  1456. X!         xc, yc, x2, y2, xd, yd);
  1457. X!     }
  1458. X  
  1459. X  #define        THRESHOLD    .05    /* inch */
  1460. X  
  1461. X
  1462. X--- 439,446 -----
  1463. X      xd = x*cosa + y*sina;
  1464. X      yd = -x*sina + y*cosa;
  1465. X      fprintf(tfp, "line from %.3f,%.3f to %.3f,%.3f to %.3f,%.3f\n",
  1466. X!     xc, yc, x2, y2, xd, yd);
  1467. X! }
  1468. X  
  1469. X  #define        THRESHOLD    .05    /* inch */
  1470. X  
  1471. X***************
  1472. X*** 397,404
  1473. X      double    x1, y1, x4, y4;
  1474. X      double    xmid, ymid;
  1475. X  
  1476. X!     x1 = a1; y1 = b1;
  1477. X!     x4 = a4; y4 = b4;
  1478. X  
  1479. X      xmid = (a2 + a3) / 2;
  1480. X      ymid = (b2 + b3) / 2;
  1481. X
  1482. X--- 450,459 -----
  1483. X      double    x1, y1, x4, y4;
  1484. X      double    xmid, ymid;
  1485. X  
  1486. X!     x1 = a1; 
  1487. X!     y1 = b1;
  1488. X!     x4 = a4; 
  1489. X!     y4 = b4;
  1490. X  
  1491. X      xmid = (a2 + a3) / 2;
  1492. X      ymid = (b2 + b3) / 2;
  1493. X***************
  1494. X*** 402,414
  1495. X  
  1496. X      xmid = (a2 + a3) / 2;
  1497. X      ymid = (b2 + b3) / 2;
  1498. X!     if (fabs(x1 - xmid) < THRESHOLD && fabs(y1 - ymid) < THRESHOLD) {
  1499. X!         fprintf(tfp, "\tto %.3f,%.3f\\\n", xmid, ymid);
  1500. X!         }
  1501. X!     else {
  1502. X!         quadratic_spline(x1, y1, ((x1+a2)/2), ((y1+b2)/2),
  1503. X!             ((3*a2+a3)/4), ((3*b2+b3)/4), xmid, ymid);
  1504. X!         }
  1505. X  
  1506. X      if (fabs(xmid - x4) < THRESHOLD && fabs(ymid - y4) < THRESHOLD) {
  1507. X          fprintf(tfp, "\tto %.3f,%.3f\\\n", x4, y4);
  1508. X
  1509. X--- 457,471 -----
  1510. X  
  1511. X      xmid = (a2 + a3) / 2;
  1512. X      ymid = (b2 + b3) / 2;
  1513. X!     if (fabs(x1 - xmid) < THRESHOLD && fabs(y1 - ymid) < THRESHOLD)
  1514. X!     {
  1515. X!         fprintf(tfp, "\tto %.3f,%.3f\\\n", xmid, ymid);
  1516. X!     }
  1517. X!     else
  1518. X!     {
  1519. X!         quadratic_spline(x1, y1, ((x1+a2)/2), ((y1+b2)/2),
  1520. X!         ((3*a2+a3)/4), ((3*b2+b3)/4), xmid, ymid);
  1521. X!     }
  1522. X  
  1523. X      if (fabs(xmid - x4) < THRESHOLD && fabs(ymid - y4) < THRESHOLD)
  1524. X      {
  1525. X***************
  1526. X*** 410,422
  1527. X              ((3*a2+a3)/4), ((3*b2+b3)/4), xmid, ymid);
  1528. X          }
  1529. X  
  1530. X!     if (fabs(xmid - x4) < THRESHOLD && fabs(ymid - y4) < THRESHOLD) {
  1531. X!         fprintf(tfp, "\tto %.3f,%.3f\\\n", x4, y4);
  1532. X!         }
  1533. X!     else {
  1534. X!         quadratic_spline(xmid, ymid, ((a2+3*a3)/4), ((b2+3*b3)/4),
  1535. X!             ((a3+x4)/2), ((b3+y4)/2), x4, y4);
  1536. X!         }
  1537. X      }
  1538. X  
  1539. X  genpic_closed_spline(s)
  1540. X
  1541. X--- 467,475 -----
  1542. X          ((3*a2+a3)/4), ((3*b2+b3)/4), xmid, ymid);
  1543. X      }
  1544. X  
  1545. X!     if (fabs(xmid - x4) < THRESHOLD && fabs(ymid - y4) < THRESHOLD)
  1546. X!     {
  1547. X!         fprintf(tfp, "\tto %.3f,%.3f\\\n", x4, y4);
  1548. X      }
  1549. X      else
  1550. X      {
  1551. X***************
  1552. X*** 418,423
  1553. X              ((a3+x4)/2), ((b3+y4)/2), x4, y4);
  1554. X          }
  1555. X      }
  1556. X  
  1557. X  genpic_closed_spline(s)
  1558. X  F_spline    *s;
  1559. X
  1560. X--- 471,482 -----
  1561. X      {
  1562. X          fprintf(tfp, "\tto %.3f,%.3f\\\n", x4, y4);
  1563. X      }
  1564. X+     else
  1565. X+     {
  1566. X+         quadratic_spline(xmid, ymid, ((a2+3*a3)/4), ((b2+3*b3)/4),
  1567. X+         ((a3+x4)/2), ((b3+y4)/2), x4, y4);
  1568. X+     }
  1569. X+ }
  1570. X  
  1571. X  genpic_closed_spline(s)
  1572. X  F_spline    *s;
  1573. X***************
  1574. X*** 426,431
  1575. X      double    cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
  1576. X      double    x1, y1, x2, y2;
  1577. X  
  1578. X      p = s->points;
  1579. X      x1 = p->x/ppi;  y1 = convy(p->y/ppi);
  1580. X      p = p->next;
  1581. X
  1582. X--- 485,491 -----
  1583. X      double    cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
  1584. X      double    x1, y1, x2, y2;
  1585. X  
  1586. X+     set_linewidth(s->thickness);
  1587. X      p = s->points;
  1588. X      x1 = p->x/ppi;  
  1589. X      y1 = convy(p->y/ppi);
  1590. X***************
  1591. X*** 427,433
  1592. X      double    x1, y1, x2, y2;
  1593. X  
  1594. X      p = s->points;
  1595. X!     x1 = p->x/ppi;  y1 = convy(p->y/ppi);
  1596. X      p = p->next;
  1597. X      x2 = p->x/ppi;  y2 = convy(p->y/ppi);
  1598. X      cx1 = (x1 + x2) / 2;      cy1 = (y1 + y2) / 2;
  1599. X
  1600. X--- 487,494 -----
  1601. X  
  1602. X      set_linewidth(s->thickness);
  1603. X      p = s->points;
  1604. X!     x1 = p->x/ppi;  
  1605. X!     y1 = convy(p->y/ppi);
  1606. X      p = p->next;
  1607. X      x2 = p->x/ppi;  
  1608. X      y2 = convy(p->y/ppi);
  1609. X***************
  1610. X*** 429,437
  1611. X      p = s->points;
  1612. X      x1 = p->x/ppi;  y1 = convy(p->y/ppi);
  1613. X      p = p->next;
  1614. X!     x2 = p->x/ppi;  y2 = convy(p->y/ppi);
  1615. X!     cx1 = (x1 + x2) / 2;      cy1 = (y1 + y2) / 2;
  1616. X!     cx2 = (x1 + 3 * x2) / 4;  cy2 = (y1 + 3 * y2) / 4;
  1617. X  
  1618. X      for (p = p->next; p != NULL; p = p->next) {
  1619. X          fprintf(tfp, "line from %.3f,%.3f ", cx1, cy1);
  1620. X
  1621. X--- 490,501 -----
  1622. X      x1 = p->x/ppi;  
  1623. X      y1 = convy(p->y/ppi);
  1624. X      p = p->next;
  1625. X!     x2 = p->x/ppi;  
  1626. X!     y2 = convy(p->y/ppi);
  1627. X!     cx1 = (x1 + x2) / 2;      
  1628. X!     cy1 = (y1 + y2) / 2;
  1629. X!     cx2 = (x1 + 3 * x2) / 4;  
  1630. X!     cy2 = (y1 + 3 * y2) / 4;
  1631. X  
  1632. X      for (p = p->next; p != NULL; p = p->next)
  1633. X      {
  1634. X***************
  1635. X*** 433,450
  1636. X      cx1 = (x1 + x2) / 2;      cy1 = (y1 + y2) / 2;
  1637. X      cx2 = (x1 + 3 * x2) / 4;  cy2 = (y1 + 3 * y2) / 4;
  1638. X  
  1639. X!     for (p = p->next; p != NULL; p = p->next) {
  1640. X!         fprintf(tfp, "line from %.3f,%.3f ", cx1, cy1);
  1641. X!         x1 = x2;  y1 = y2;
  1642. X!         x2 = p->x/ppi;  y2 = convy(p->y/ppi);
  1643. X!         cx3 = (3 * x1 + x2) / 4;  cy3 = (3 * y1 + y2) / 4;
  1644. X!         cx4 = (x1 + x2) / 2;      cy4 = (y1 + y2) / 2;
  1645. X!         quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
  1646. X!         fprintf(tfp, "\n");
  1647. X!         cx1 = cx4;  cy1 = cy4;
  1648. X!         cx2 = (x1 + 3 * x2) / 4;  cy2 = (y1 + 3 * y2) / 4;
  1649. X!         }
  1650. X!     x1 = x2;  y1 = y2;
  1651. X      p = s->points->next;
  1652. X      x2 = p->x/ppi;  y2 = convy(p->y/ppi);
  1653. X      cx3 = (3 * x1 + x2) / 4;  cy3 = (3 * y1 + y2) / 4;
  1654. X
  1655. X--- 497,522 -----
  1656. X      cx2 = (x1 + 3 * x2) / 4;  
  1657. X      cy2 = (y1 + 3 * y2) / 4;
  1658. X  
  1659. X!     for (p = p->next; p != NULL; p = p->next)
  1660. X!     {
  1661. X!         fprintf(tfp, "line from %.3f,%.3f ", cx1, cy1);
  1662. X!         x1 = x2;  
  1663. X!         y1 = y2;
  1664. X!         x2 = p->x/ppi;  
  1665. X!         y2 = convy(p->y/ppi);
  1666. X!         cx3 = (3 * x1 + x2) / 4;  
  1667. X!         cy3 = (3 * y1 + y2) / 4;
  1668. X!         cx4 = (x1 + x2) / 2;      
  1669. X!         cy4 = (y1 + y2) / 2;
  1670. X!         quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
  1671. X!         fprintf(tfp, "\n");
  1672. X!         cx1 = cx4;  
  1673. X!         cy1 = cy4;
  1674. X!         cx2 = (x1 + 3 * x2) / 4;  
  1675. X!         cy2 = (y1 + 3 * y2) / 4;
  1676. X!     }
  1677. X!     x1 = x2;  
  1678. X!     y1 = y2;
  1679. X      p = s->points->next;
  1680. X      x2 = p->x/ppi;  
  1681. X      y2 = convy(p->y/ppi);
  1682. X***************
  1683. X*** 446,454
  1684. X          }
  1685. X      x1 = x2;  y1 = y2;
  1686. X      p = s->points->next;
  1687. X!     x2 = p->x/ppi;  y2 = convy(p->y/ppi);
  1688. X!     cx3 = (3 * x1 + x2) / 4;  cy3 = (3 * y1 + y2) / 4;
  1689. X!     cx4 = (x1 + x2) / 2;      cy4 = (y1 + y2) / 2;
  1690. X      fprintf(tfp, "line from %.3f,%.3f ", cx1, cy1);
  1691. X      quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
  1692. X      fprintf(tfp, "\n");
  1693. X
  1694. X--- 518,529 -----
  1695. X      x1 = x2;  
  1696. X      y1 = y2;
  1697. X      p = s->points->next;
  1698. X!     x2 = p->x/ppi;  
  1699. X!     y2 = convy(p->y/ppi);
  1700. X!     cx3 = (3 * x1 + x2) / 4;  
  1701. X!     cy3 = (3 * y1 + y2) / 4;
  1702. X!     cx4 = (x1 + x2) / 2;      
  1703. X!     cy4 = (y1 + y2) / 2;
  1704. X      fprintf(tfp, "line from %.3f,%.3f ", cx1, cy1);
  1705. X      quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
  1706. X      fprintf(tfp, "\n");
  1707. X***************
  1708. X*** 452,458
  1709. X      fprintf(tfp, "line from %.3f,%.3f ", cx1, cy1);
  1710. X      quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
  1711. X      fprintf(tfp, "\n");
  1712. X!     }
  1713. X  
  1714. X  genpic_itp_spline(s)
  1715. X  F_spline    *s;
  1716. X
  1717. X--- 527,533 -----
  1718. X      fprintf(tfp, "line from %.3f,%.3f ", cx1, cy1);
  1719. X      quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
  1720. X      fprintf(tfp, "\n");
  1721. X! }
  1722. X  
  1723. X  genpic_itp_spline(s)
  1724. X  F_spline    *s;
  1725. X***************
  1726. X*** 464,470
  1727. X      p1 = s->points;
  1728. X      cp1 = s->controls;
  1729. X      cp2 = cp1->next;
  1730. X!     x2 = p1->x/ppi; y2 = convy(p1->y/ppi);
  1731. X  
  1732. X      if (s->back_arrow)
  1733. X          draw_arrow_head(cp2->lx/ppi, convy(cp2->ly/ppi), x2, y2,
  1734. X
  1735. X--- 539,546 -----
  1736. X      p1 = s->points;
  1737. X      cp1 = s->controls;
  1738. X      cp2 = cp1->next;
  1739. X!     x2 = p1->x/ppi; 
  1740. X!     y2 = convy(p1->y/ppi);
  1741. X  
  1742. X      if (s->back_arrow)
  1743. X          draw_arrow_head(cp2->lx/ppi, convy(cp2->ly/ppi), x2, y2,
  1744. X***************
  1745. X*** 467,473
  1746. X      x2 = p1->x/ppi; y2 = convy(p1->y/ppi);
  1747. X  
  1748. X      if (s->back_arrow)
  1749. X!         draw_arrow_head(cp2->lx/ppi, convy(cp2->ly/ppi), x2, y2,
  1750. X          s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  1751. X  
  1752. X      for (p2 = p1->next, cp2 = cp1->next; p2 != NULL;
  1753. X
  1754. X--- 543,549 -----
  1755. X      y2 = convy(p1->y/ppi);
  1756. X  
  1757. X      if (s->back_arrow)
  1758. X!         draw_arrow_head(cp2->lx/ppi, convy(cp2->ly/ppi), x2, y2,
  1759. X          s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  1760. X  
  1761. X      for (p2 = p1->next, cp2 = cp1->next; p2 != NULL;
  1762. X***************
  1763. X*** 471,481
  1764. X          s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  1765. X  
  1766. X      for (p2 = p1->next, cp2 = cp1->next; p2 != NULL;
  1767. X!         p1 = p2, cp1 = cp2, p2 = p2->next, cp2 = cp2->next) {
  1768. X!         fprintf(tfp, "line from %.3f,%.3f ", x2, y2);
  1769. X!         x1 = x2; y1 = y2;
  1770. X!         x2 = p2->x/ppi; y2 = convy(p2->y/ppi);
  1771. X!         bezier_spline(x1, y1, (double)cp1->rx/ppi, convy(cp1->ry/ppi),
  1772. X          (double)cp2->lx/ppi, convy(cp2->ly/ppi), x2, y2);
  1773. X          fprintf(tfp, "\n");
  1774. X          }
  1775. X
  1776. X--- 547,560 -----
  1777. X          s->back_arrow->ht/ppi, s->back_arrow->wid/ppi);
  1778. X  
  1779. X      for (p2 = p1->next, cp2 = cp1->next; p2 != NULL;
  1780. X!         p1 = p2, cp1 = cp2, p2 = p2->next, cp2 = cp2->next)
  1781. X!         {
  1782. X!             fprintf(tfp, "line from %.3f,%.3f ", x2, y2);
  1783. X!         x1 = x2; 
  1784. X!         y1 = y2;
  1785. X!         x2 = p2->x/ppi; 
  1786. X!         y2 = convy(p2->y/ppi);
  1787. X!         bezier_spline(x1, y1, (double)cp1->rx/ppi, convy(cp1->ry/ppi),
  1788. X          (double)cp2->lx/ppi, convy(cp2->ly/ppi), x2, y2);
  1789. X          fprintf(tfp, "\n");
  1790. X      }
  1791. X***************
  1792. X*** 477,484
  1793. X          x2 = p2->x/ppi; y2 = convy(p2->y/ppi);
  1794. X          bezier_spline(x1, y1, (double)cp1->rx/ppi, convy(cp1->ry/ppi),
  1795. X          (double)cp2->lx/ppi, convy(cp2->ly/ppi), x2, y2);
  1796. X!         fprintf(tfp, "\n");
  1797. X!         }
  1798. X  
  1799. X      if (s->for_arrow)
  1800. X          draw_arrow_head((double)cp1->lx/ppi, convy(cp1->ly/ppi), x1, y1,
  1801. X
  1802. X--- 556,563 -----
  1803. X          y2 = convy(p2->y/ppi);
  1804. X          bezier_spline(x1, y1, (double)cp1->rx/ppi, convy(cp1->ry/ppi),
  1805. X          (double)cp2->lx/ppi, convy(cp2->ly/ppi), x2, y2);
  1806. X!         fprintf(tfp, "\n");
  1807. X!     }
  1808. X  
  1809. X      if (s->for_arrow)
  1810. X          draw_arrow_head((double)cp1->lx/ppi, convy(cp1->ly/ppi), x1, y1,
  1811. X***************
  1812. X*** 481,487
  1813. X          }
  1814. X  
  1815. X      if (s->for_arrow)
  1816. X!         draw_arrow_head((double)cp1->lx/ppi, convy(cp1->ly/ppi), x1, y1,
  1817. X          (double)s->for_arrow->ht/ppi, (double)s->for_arrow->wid/ppi);
  1818. X      }
  1819. X  
  1820. X
  1821. X--- 560,566 -----
  1822. X      }
  1823. X  
  1824. X      if (s->for_arrow)
  1825. X!         draw_arrow_head((double)cp1->lx/ppi, convy(cp1->ly/ppi), x1, y1,
  1826. X          (double)s->for_arrow->ht/ppi, (double)s->for_arrow->wid/ppi);
  1827. X  }
  1828. X  
  1829. X***************
  1830. X*** 483,489
  1831. X      if (s->for_arrow)
  1832. X          draw_arrow_head((double)cp1->lx/ppi, convy(cp1->ly/ppi), x1, y1,
  1833. X          (double)s->for_arrow->ht/ppi, (double)s->for_arrow->wid/ppi);
  1834. X!     }
  1835. X  
  1836. X  bezier_spline(a0, b0, a1, b1, a2, b2, a3, b3)
  1837. X  double    a0, b0, a1, b1, a2, b2, a3, b3;
  1838. X
  1839. X--- 562,568 -----
  1840. X      if (s->for_arrow)
  1841. X          draw_arrow_head((double)cp1->lx/ppi, convy(cp1->ly/ppi), x1, y1,
  1842. X          (double)s->for_arrow->ht/ppi, (double)s->for_arrow->wid/ppi);
  1843. X! }
  1844. X  
  1845. X  bezier_spline(a0, b0, a1, b1, a2, b2, a3, b3)
  1846. X  double    a0, b0, a1, b1, a2, b2, a3, b3;
  1847. X***************
  1848. X*** 491,508
  1849. X      double    x0, y0, x3, y3;
  1850. X      double    sx1, sy1, sx2, sy2, tx, ty, tx1, ty1, tx2, ty2, xmid, ymid;
  1851. X  
  1852. X!     x0 = a0; y0 = b0;
  1853. X!     x3 = a3; y3 = b3;
  1854. X!     if (fabs(x0 - x3) < THRESHOLD && fabs(y0 - y3) < THRESHOLD) {
  1855. X!         fprintf(tfp, "\tto %.3f,%.3f\\\n", x3, y3);
  1856. X!         }
  1857. X!     else {
  1858. X!         tx = (a1 + a2) / 2;        ty = (b1 + b2) / 2;
  1859. X!         sx1 = (x0 + a1) / 2;    sy1 = (y0 + b1) / 2;
  1860. X!         sx2 = (sx1 + tx) / 2;    sy2 = (sy1 + ty) / 2;
  1861. X!         tx2 = (a2 + x3) / 2;    ty2 = (b2 + y3) / 2;
  1862. X!         tx1 = (tx2 + tx) / 2;    ty1 = (ty2 + ty) / 2;
  1863. X!         xmid = (sx2 + tx1) / 2;    ymid = (sy2 + ty1) / 2;
  1864. X  
  1865. X          bezier_spline(x0, y0, sx1, sy1, sx2, sy2, xmid, ymid);
  1866. X          bezier_spline(xmid, ymid, tx1, ty1, tx2, ty2, x3, y3);
  1867. X
  1868. X--- 570,597 -----
  1869. X      double    x0, y0, x3, y3;
  1870. X      double    sx1, sy1, sx2, sy2, tx, ty, tx1, ty1, tx2, ty2, xmid, ymid;
  1871. X  
  1872. X!     x0 = a0; 
  1873. X!     y0 = b0;
  1874. X!     x3 = a3; 
  1875. X!     y3 = b3;
  1876. X!     if (fabs(x0 - x3) < THRESHOLD && fabs(y0 - y3) < THRESHOLD)
  1877. X!     {
  1878. X!         fprintf(tfp, "\tto %.3f,%.3f\\\n", x3, y3);
  1879. X!     }
  1880. X!     else
  1881. X!     {
  1882. X!         tx = (a1 + a2) / 2;        
  1883. X!         ty = (b1 + b2) / 2;
  1884. X!         sx1 = (x0 + a1) / 2;    
  1885. X!         sy1 = (y0 + b1) / 2;
  1886. X!         sx2 = (sx1 + tx) / 2;    
  1887. X!         sy2 = (sy1 + ty) / 2;
  1888. X!         tx2 = (a2 + x3) / 2;    
  1889. X!         ty2 = (b2 + y3) / 2;
  1890. X!         tx1 = (tx2 + tx) / 2;    
  1891. X!         ty1 = (ty2 + ty) / 2;
  1892. X!         xmid = (sx2 + tx1) / 2;    
  1893. X!         ymid = (sy2 + ty1) / 2;
  1894. X  
  1895. X          bezier_spline(x0, y0, sx1, sy1, sx2, sy2, xmid, ymid);
  1896. X          bezier_spline(xmid, ymid, tx1, ty1, tx2, ty2, x3, y3);
  1897. X***************
  1898. X*** 504,510
  1899. X          tx1 = (tx2 + tx) / 2;    ty1 = (ty2 + ty) / 2;
  1900. X          xmid = (sx2 + tx1) / 2;    ymid = (sy2 + ty1) / 2;
  1901. X  
  1902. X!         bezier_spline(x0, y0, sx1, sy1, sx2, sy2, xmid, ymid);
  1903. X!         bezier_spline(xmid, ymid, tx1, ty1, tx2, ty2, x3, y3);
  1904. X!         }
  1905. X      }
  1906. X
  1907. X--- 593,600 -----
  1908. X          xmid = (sx2 + tx1) / 2;    
  1909. X          ymid = (sy2 + ty1) / 2;
  1910. X  
  1911. X!         bezier_spline(x0, y0, sx1, sy1, sx2, sy2, xmid, ymid);
  1912. X!         bezier_spline(xmid, ymid, tx1, ty1, tx2, ty2, x3, y3);
  1913. X      }
  1914. X  }
  1915. X  
  1916. X***************
  1917. X*** 508,510
  1918. X          bezier_spline(xmid, ymid, tx1, ty1, tx2, ty2, x3, y3);
  1919. X          }
  1920. X      }
  1921. X
  1922. X--- 596,600 -----
  1923. X          bezier_spline(x0, y0, sx1, sy1, sx2, sy2, xmid, ymid);
  1924. X          bezier_spline(xmid, ymid, tx1, ty1, tx2, ty2, x3, y3);
  1925. X      }
  1926. X+ }
  1927. X+ 
  1928. END_OF_FILE
  1929. if test 44019 -ne `wc -c <'f2p.c.diff'`; then
  1930.     echo shar: \"'f2p.c.diff'\" unpacked with wrong size!
  1931. fi
  1932. # end of 'f2p.c.diff'
  1933. fi
  1934. echo shar: End of archive 6 \(of 7\).
  1935. cp /dev/null ark6isdone
  1936. MISSING=""
  1937. for I in 1 2 3 4 5 6 7 ; do
  1938.     if test ! -f ark${I}isdone ; then
  1939.     MISSING="${MISSING} ${I}"
  1940.     fi
  1941. done
  1942. if test "${MISSING}" = "" ; then
  1943.     echo You have unpacked all 7 archives.
  1944.     rm -f ark[1-9]isdone
  1945. else
  1946.     echo You still need to unpack the following archives:
  1947.     echo "        " ${MISSING}
  1948. fi
  1949. ##  End of shell archive.
  1950. exit 0
  1951.  
  1952. dan
  1953. -----------------------------------------------------------
  1954.             O'Reilly && Associates
  1955.         argv@sun.com / argv@ora.com
  1956.        632 Petaluma Ave, Sebastopol, CA 95472 
  1957.      800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
  1958.     Opinions expressed reflect those of the author only.
  1959.